feat(mgmt): add engine management API#757
Conversation
Add descopeClient.management.engine with create / update / delete / load / loadAll / rotateSecret, mirroring the other management resources. Engines are managed via the management API (e.g. by the Terraform provider); see descope/backend#1614 for the backend endpoints. The engine secret is returned only by create and rotateSecret — load/loadAll never include it. Engine numeric fields are typed as string because the management gateway serializes proto int64 values as JSON strings. Includes the engine module, paths, types, management wiring, README docs, and unit tests. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
🐕 Review complete — View session on Shuni Portal 🐾 |
🐕 Suggested ReviewersThe review assignment strategy prioritized recent contributors to files directly involved in the management API and related modules. This ensures reviewers are familiar with the latest changes and the specific areas impacted by this PR.
Suggested by Shuni based on git history and PR context. Names are not @-mentioned to avoid notifying anyone — request a review from whoever fits best. |
There was a problem hiding this comment.
🐕 Shuni's Review
Adds management.engine with create/update/delete/load/loadAll/rotateSecret, types, paths, README, and full unit tests.
No issues found — good bones! Clean wrapper that mirrors the existing managementKey pattern, secret handling matches documented backend behavior, and all six methods are tested. Woof!
Match the dedicated management Engine message (descope/backend#1614): drop the EngineService-internal fields (projectId, version, modifiedTime, lastSync, imageVersion, contentVersion) that are no longer returned. createdTime is now a numeric epoch-seconds value. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
What
Adds
descopeClient.management.enginewith:create(name)→ returns the new engine incl. its generated id and secretupdate(id, name)delete(id)load(id)/loadAll()— secret is always emptyrotateSecret(id)→ returns the new secret (previous one invalidated)Engines are managed via the management API (e.g. by the Terraform provider). The backend management endpoints live in descope/backend#1614.
Notes
createandrotateSecret;load/loadAllnever include it (matches backend behavior).Enginenumeric fields (version/createdTime/...) are typedstringbecause the management gateway serializes proto int64 as JSON strings.Includes
lib/management/engine.ts, paths,Engine/EngineSecretResponsetypes, management wiring (index.ts), README section, and unit tests.Testing
eslint+prettierclean,npm run build(types) clean🤖 Generated with Claude Code